<%--
  Created by IntelliJ IDEA.
  User: 韦树达
  Date: 2024/12/20
  Time: 22:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="../css/admin_nav.css" />
    <link rel="stylesheet" href="../css/yishi_gl.css">
</head>
<body>
<jsp:include page="admin.jsp" />
<div class="container">
    <jsp:include page="admin_nav.jsp" />
        <div class="main">
            <div class="header">
                <input type="text" class="search-box" placeholder="请输入搜索内容" id="searchInput">
                <div class="button-group">
                    <button class="btn btn-primary" onclick="showEditModal()">新增</button>
                    <button class="btn btn-danger" onclick="showDeleteMultipleModal()" id="batchDeleteBtn">批量删除</button>
                </div>
            </div>

            <table>
                <thead>
                <tr>
                    <th><input type="checkbox" class="checkbox" id="selectAll"></th>
                    <th>序号</th>
                    <th>姓名</th>
                    <th>岗位</th>
                    <th>简介</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="tableBody">
                <!-- Table content will be dynamically generated -->
                </tbody>
            </table>

            <div class="footer">
                <div id="totalCount">共0条数据</div>
                <div class="pagination">
                    <button class="page-btn" onclick="prevPage()">&lt;</button>
                    <button class="page-btn active">1</button>
                    <button class="page-btn" onclick="nextPage()">&gt;</button>
                </div>
            </div>
        </div>

        <!-- Edit Modal -->
        <div class="modal" id="editModal">
            <div class="modal-content">
                <div class="modal-header">
                    <h3 id="modalTitle">编辑</h3>
                    <span class="close" onclick="hideEditModal()">&times;</span>
                </div>
                <form id="editForm">
                    <input type="hidden" id="editId">
                    <div class="form-group">
                        <label class="required">姓名:</label>
                        <input type="text" class="form-control" id="editName" required>
                    </div>
                    <div class="form-group">
                        <label>头像:</label>
                        <div class="image-upload" id="imageUpload">
                            <p>请选择要上传的图片</p>
                            <input type="file" accept="image/*" style="display: none" id="fileInput">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="required">岗位:</label>
                        <input type="text" class="form-control" id="editPosition" required>
                    </div>
                    <div class="form-group">
                        <label>简介:</label>
                        <textarea class="form-control" id="editDescription" rows="3"></textarea>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-success">确认</button>
                        <button type="button" class="btn btn-danger" onclick="hideEditModal()">取消</button>
                    </div>
                </form>
            </div>
        </div>

        <!-- Delete Confirmation Modal -->
        <div class="modal" id="deleteModal">
            <div class="modal-content">
                <div class="modal-header">
                    <h3>确认删除吗？</h3>
                    <span class="close" onclick="hideDeleteModal()">&times;</span>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-success" onclick="confirmDelete()">确认</button>
                    <button class="btn btn-danger" onclick="hideDeleteModal()">取消</button>
                </div>
            </div>
        </div>
        <script src="../js/yishi_gl.js"></script>
</body>
</html>
